package cn.zero.controller;

import cn.zero.domain.Result;
import cn.zero.domain.Store;
import cn.zero.service.IStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/store")
public class StoreController {

    @Autowired
    private IStoreService iStoreService;

    @PostMapping("/save")
    public Result save(@RequestBody Store store){
        try {
            iStoreService.save(store);
            return new Result(true,"操作成功");
        } catch (Exception e){
            e.printStackTrace();
            return new Result(false,"操作失败");
        }
    }


}
